\(\int \frac {\sec ^5(c+d x)}{(a+i a \tan (c+d x))^2} \, dx\) [124]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 24, antiderivative size = 74 \[ \int \frac {\sec ^5(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=\frac {3 \text {arctanh}(\sin (c+d x))}{2 a^2 d}+\frac {3 \sec (c+d x) \tan (c+d x)}{2 a^2 d}-\frac {2 i \sec ^3(c+d x)}{d \left (a^2+i a^2 \tan (c+d x)\right )} \]

[Out]

3/2*arctanh(sin(d*x+c))/a^2/d+3/2*sec(d*x+c)*tan(d*x+c)/a^2/d-2*I*sec(d*x+c)^3/d/(a^2+I*a^2*tan(d*x+c))

Rubi [A] (verified)

Time = 0.08 (sec) , antiderivative size = 74, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {3581, 3853, 3855} \[ \int \frac {\sec ^5(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=\frac {3 \text {arctanh}(\sin (c+d x))}{2 a^2 d}-\frac {2 i \sec ^3(c+d x)}{d \left (a^2+i a^2 \tan (c+d x)\right )}+\frac {3 \tan (c+d x) \sec (c+d x)}{2 a^2 d} \]

[In]

Int[Sec[c + d*x]^5/(a + I*a*Tan[c + d*x])^2,x]

[Out]

(3*ArcTanh[Sin[c + d*x]])/(2*a^2*d) + (3*Sec[c + d*x]*Tan[c + d*x])/(2*a^2*d) - ((2*I)*Sec[c + d*x]^3)/(d*(a^2
 + I*a^2*Tan[c + d*x]))

Rule 3581

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[2*d^2*
(d*Sec[e + f*x])^(m - 2)*((a + b*Tan[e + f*x])^(n + 1)/(b*f*(m + 2*n))), x] - Dist[d^2*((m - 2)/(b^2*(m + 2*n)
)), Int[(d*Sec[e + f*x])^(m - 2)*(a + b*Tan[e + f*x])^(n + 2), x], x] /; FreeQ[{a, b, d, e, f, m}, x] && EqQ[a
^2 + b^2, 0] && LtQ[n, -1] && ((ILtQ[n/2, 0] && IGtQ[m - 1/2, 0]) || EqQ[n, -2] || IGtQ[m + n, 0] || (Integers
Q[n, m + 1/2] && GtQ[2*m + n + 1, 0])) && IntegerQ[2*m]

Rule 3853

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Csc[c + d*x])^(n - 1)/(d*(n
- 1))), x] + Dist[b^2*((n - 2)/(n - 1)), Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n,
 1] && IntegerQ[2*n]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = -\frac {2 i \sec ^3(c+d x)}{d \left (a^2+i a^2 \tan (c+d x)\right )}+\frac {3 \int \sec ^3(c+d x) \, dx}{a^2} \\ & = \frac {3 \sec (c+d x) \tan (c+d x)}{2 a^2 d}-\frac {2 i \sec ^3(c+d x)}{d \left (a^2+i a^2 \tan (c+d x)\right )}+\frac {3 \int \sec (c+d x) \, dx}{2 a^2} \\ & = \frac {3 \text {arctanh}(\sin (c+d x))}{2 a^2 d}+\frac {3 \sec (c+d x) \tan (c+d x)}{2 a^2 d}-\frac {2 i \sec ^3(c+d x)}{d \left (a^2+i a^2 \tan (c+d x)\right )} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.76 (sec) , antiderivative size = 146, normalized size of antiderivative = 1.97 \[ \int \frac {\sec ^5(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=-\frac {\sec ^2(c+d x) \left (8 i \cos (c+d x)+3 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+3 \cos (2 (c+d x)) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )-3 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+2 \sin (c+d x)\right )}{4 a^2 d} \]

[In]

Integrate[Sec[c + d*x]^5/(a + I*a*Tan[c + d*x])^2,x]

[Out]

-1/4*(Sec[c + d*x]^2*((8*I)*Cos[c + d*x] + 3*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + 3*Cos[2*(c + d*x)]*(Lo
g[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] - Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]]) - 3*Log[Cos[(c + d*x)/2] +
Sin[(c + d*x)/2]] + 2*Sin[c + d*x]))/(a^2*d)

Maple [A] (verified)

Time = 0.69 (sec) , antiderivative size = 89, normalized size of antiderivative = 1.20

method result size
risch \(-\frac {i \left (3 \,{\mathrm e}^{3 i \left (d x +c \right )}+5 \,{\mathrm e}^{i \left (d x +c \right )}\right )}{d \,a^{2} \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 a^{2} d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 a^{2} d}\) \(89\)
derivativedivides \(\frac {\frac {2 \left (-\frac {1}{4}+i\right )}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1}-\frac {1}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}-\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2}+\frac {2 \left (-\frac {1}{4}-i\right )}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1}+\frac {1}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}+\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2}}{a^{2} d}\) \(102\)
default \(\frac {\frac {2 \left (-\frac {1}{4}+i\right )}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1}-\frac {1}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}-\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2}+\frac {2 \left (-\frac {1}{4}-i\right )}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1}+\frac {1}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}+\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2}}{a^{2} d}\) \(102\)

[In]

int(sec(d*x+c)^5/(a+I*a*tan(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

-I/d/a^2/(exp(2*I*(d*x+c))+1)^2*(3*exp(3*I*(d*x+c))+5*exp(I*(d*x+c)))+3/2/a^2/d*ln(exp(I*(d*x+c))+I)-3/2/a^2/d
*ln(exp(I*(d*x+c))-I)

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 134 vs. \(2 (66) = 132\).

Time = 0.24 (sec) , antiderivative size = 134, normalized size of antiderivative = 1.81 \[ \int \frac {\sec ^5(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=\frac {3 \, {\left (e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )} \log \left (e^{\left (i \, d x + i \, c\right )} + i\right ) - 3 \, {\left (e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )} \log \left (e^{\left (i \, d x + i \, c\right )} - i\right ) - 6 i \, e^{\left (3 i \, d x + 3 i \, c\right )} - 10 i \, e^{\left (i \, d x + i \, c\right )}}{2 \, {\left (a^{2} d e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, a^{2} d e^{\left (2 i \, d x + 2 i \, c\right )} + a^{2} d\right )}} \]

[In]

integrate(sec(d*x+c)^5/(a+I*a*tan(d*x+c))^2,x, algorithm="fricas")

[Out]

1/2*(3*(e^(4*I*d*x + 4*I*c) + 2*e^(2*I*d*x + 2*I*c) + 1)*log(e^(I*d*x + I*c) + I) - 3*(e^(4*I*d*x + 4*I*c) + 2
*e^(2*I*d*x + 2*I*c) + 1)*log(e^(I*d*x + I*c) - I) - 6*I*e^(3*I*d*x + 3*I*c) - 10*I*e^(I*d*x + I*c))/(a^2*d*e^
(4*I*d*x + 4*I*c) + 2*a^2*d*e^(2*I*d*x + 2*I*c) + a^2*d)

Sympy [F]

\[ \int \frac {\sec ^5(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=- \frac {\int \frac {\sec ^{5}{\left (c + d x \right )}}{\tan ^{2}{\left (c + d x \right )} - 2 i \tan {\left (c + d x \right )} - 1}\, dx}{a^{2}} \]

[In]

integrate(sec(d*x+c)**5/(a+I*a*tan(d*x+c))**2,x)

[Out]

-Integral(sec(c + d*x)**5/(tan(c + d*x)**2 - 2*I*tan(c + d*x) - 1), x)/a**2

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 167 vs. \(2 (66) = 132\).

Time = 0.27 (sec) , antiderivative size = 167, normalized size of antiderivative = 2.26 \[ \int \frac {\sec ^5(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=-\frac {\frac {2 \, {\left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {4 i \, \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + 4 i\right )}}{a^{2} - \frac {2 \, a^{2} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {a^{2} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}} - \frac {3 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{a^{2}} + \frac {3 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{a^{2}}}{2 \, d} \]

[In]

integrate(sec(d*x+c)^5/(a+I*a*tan(d*x+c))^2,x, algorithm="maxima")

[Out]

-1/2*(2*(sin(d*x + c)/(cos(d*x + c) + 1) - 4*I*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 + sin(d*x + c)^3/(cos(d*x +
 c) + 1)^3 + 4*I)/(a^2 - 2*a^2*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 + a^2*sin(d*x + c)^4/(cos(d*x + c) + 1)^4)
- 3*log(sin(d*x + c)/(cos(d*x + c) + 1) + 1)/a^2 + 3*log(sin(d*x + c)/(cos(d*x + c) + 1) - 1)/a^2)/d

Giac [A] (verification not implemented)

none

Time = 0.47 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.28 \[ \int \frac {\sec ^5(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=\frac {\frac {3 \, \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}{a^{2}} - \frac {3 \, \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right )}{a^{2}} - \frac {2 \, {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 4 i \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 4 i\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2} a^{2}}}{2 \, d} \]

[In]

integrate(sec(d*x+c)^5/(a+I*a*tan(d*x+c))^2,x, algorithm="giac")

[Out]

1/2*(3*log(tan(1/2*d*x + 1/2*c) + 1)/a^2 - 3*log(tan(1/2*d*x + 1/2*c) - 1)/a^2 - 2*(tan(1/2*d*x + 1/2*c)^3 - 4
*I*tan(1/2*d*x + 1/2*c)^2 + tan(1/2*d*x + 1/2*c) + 4*I)/((tan(1/2*d*x + 1/2*c)^2 - 1)^2*a^2))/d

Mupad [B] (verification not implemented)

Time = 4.92 (sec) , antiderivative size = 104, normalized size of antiderivative = 1.41 \[ \int \frac {\sec ^5(c+d x)}{(a+i a \tan (c+d x))^2} \, dx=\frac {3\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a^2\,d}-\frac {\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{a^2}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a^2}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,4{}\mathrm {i}}{a^2}+\frac {4{}\mathrm {i}}{a^2}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \]

[In]

int(1/(cos(c + d*x)^5*(a + a*tan(c + d*x)*1i)^2),x)

[Out]

(3*atanh(tan(c/2 + (d*x)/2)))/(a^2*d) - (tan(c/2 + (d*x)/2)^3/a^2 - (tan(c/2 + (d*x)/2)^2*4i)/a^2 + 4i/a^2 + t
an(c/2 + (d*x)/2)/a^2)/(d*(tan(c/2 + (d*x)/2)^4 - 2*tan(c/2 + (d*x)/2)^2 + 1))